package ru.xeden.web.html.dom;

public interface MarkupModel
{
    /**
     * Encodes the characters, converting control characters (such as '&lt;') into corresponding entities (such as
     * &amp;lt;).
     *
     * @param content to be filtered
     * @return the filtered content
     */
    String encode(String content);

    /**
     * Encodes the characters into the buffer for use in a quoted value (that is, an attribute value), converting
     * control characters (such as '&lt;') into corresponding entities (such as &amp;lt;). In addition, double quotes
     * must be quoted or otherwise escaped.
     *
     * @param content to be filtered
     * @param buffer  to receive the filtered content
     */
    void encodeQuoted(String content, StringBuilder buffer);

    /**
     * What character is used when generating quotes around attribute values? This will be either a single or double
     * quote.
     *
     * @return single (') or double (") quote
     * @since 5.1.0.0
     */
    char getAttributeQuote();
}
